package com.azier.kapacitor.script.node;

import com.azier.kapacitor.script.arg.OriginalArg;
import com.azier.kapacitor.script.method.Quiet;
import com.azier.kapacitor.script.node.nodebind.*;
import com.azier.kapacitor.script.node.nodebind.qlnodebind.*;

import java.util.ArrayList;

/**
* 1 * @Author: luoj
* 2 * @Date: 2019/11/8 11:27
* 3
*/

/**
Create a new node that shifts the incoming points or batches in time.
**/
/**
创建一个新节点，该节点将及时更改传入的点或批次。
**/
public class ShiftNode extends AbstractNode implements AlertNodeBind, BarrierNodeBind, BottomNodeBind, ChangeDetectNodeBind, CombineNodeBind, CountNodeBind,
        CumulativeSumNodeBind, DefaultNodeBind, DeleteNodeBind, DerivativeNodeBind, DifferenceNodeBind, DistinctNodeBind, Ec2AutoscaleNodeBind,
        ElapsedNodeBind, EvalNodeBind, FirstNodeBind, FlattenNodeBind, HoltWintersNodeBind, HoltWintersWithFitNodeBind, HttpOutNodeBind, HttpPostNodeBind,
        InfluxDBOutNodeBind, JoinNodeBind, K8sAutoscaleNodeBind, KapacitorLoopbackNodeBind, LastNodeBind, LogNodeBind, MaxNodeBind, MeanNodeBind,
        MedianNodeBind, MinNodeBind, ModeNodeBind, MovingAverageNodeBind, PercentileNodeBind, SampleNodeBind, ShiftNodeBind, SideloadNodeBind,
        SpreadNodeBind, StateCountNodeBind, StateDurationNodeBind, StatsNodeBind, StddevNodeBind, SumNodeBind, SwarmAutoscaleNodeBind, TopNodeBind,
        UnionNodeBind, WhereNodeBind, WindowNodeBind {
    private static final String name = "shift";

    public ShiftNode(long interval, String durationLiteral) {
        super(new ArrayList<>(),new ArrayList<>(),name);
        //
        this.args.add(new OriginalArg(interval + durationLiteral));
    }

    /**
    Suppress all error logging events from this node.
    **/
    /**
    
    **/
    public ShiftNode quiet(){
        Quiet quiet = new Quiet();
        super.addMethod(quiet);
        return this;
    }
}